#-*- coding: utf-8 -*-
from django.conf.urls.defaults import *
from django.contrib.auth import views as auth_views
from admin import comics_admin

import auth
import views

urlpatterns = patterns('',
    # admin controls
    url(r'^admin/(.*)$', comics_admin.root),
    
    url(r'^logout/$', auth.logout, name="comics.logout"),
    
    # showing all the recorded comic books
    # edit this with a generic redirect, in case you want to
    # show only one comic book
    url(r'^$', views.index, name="comics.index"),
    
    url(r'^status/$', views.status, name="comics.status"),
    
    # showing the comic book
    # example : comic_book/ <= shows the latest comic from comic_book
    url(r'^webcomic/(?P<book_slug>[\w-]+)/$',
        views.webcomic, name="comics.webcomic"),
    
    # doing stuff with the comic book, like editing, consulting or adding someting
    # example : comic_book/random/ <= shows random comic page
    url(r'^webcomic/(?P<book_slug>[\w-]+)/(?P<act>[current|add|last|random|first|comment|archive|configure]\w+)/$',
        views.webcomic, name="comics.webcomic.act"),
    
    # showing a comic
    # example: comic_book/10 <= shows comic 10 from comic_book
    url(r'^webcomic/(?P<book_slug>[\w-]+)/(?P<strip_id>\d+)/strip/$',
        views.strip, name="comics.strip"),
    
    # doing stuff with a comic
    # example : comic_book/10/edit <= edit comic 10 from comic_book
    url(r'^webcomic/(?P<book_slug>[\w-]+)/(?P<strip_id>\d+)/(?P<act>[edit|del]\w+)/$',
        views.strip, name="comics.strip.act"),
    
)